﻿namespace GistDescriptor.Tools
{
    public class Node
    {
        private float _key;
        private Node _right;
        private Node _left;
        private Node _parent;
        private int _balance;
        private Bucket _elements;

        public Node(float k, Node p)
        {
            _key = k;
            _parent = p;
            _balance = 0;
            _elements = new Bucket();
        }

        public Bucket elements
        {
            get{ return _elements; }
            
        }

        public int balance
        {
            get{return _balance;}
            set{_balance = value; }
        }

        public float key
        {
            get{return _key;}
        }

        public Node left
        {
            get{return _left;}
            set{_left = value;}
        }

        public Node right
        {
            get{return _right;}
            set{_right = value;}
        }

        public Node parent
        {
            get{return _parent;}
            set{_parent = value;}
        }

        

        public void add(System.String path)
        {
            _elements.push(path);
        }

        public System.String remove()
        {
            return _elements.pop();
        }

        public bool isEmpty()
        {
           return _elements.isEmpty();
        }

        public System.Collections.Generic.List<string> toArray()
        {
           return _elements.toArray();
        }
    }
}
